package com.example.chat.pojo.bo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * <p>
 * 用户实体
 * </p>
 *
 * @author 林邵晨
 * @since 2023-07-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "tb_user",autoResultMap = true)
public class User extends Model<User> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("用户名")
    private String username;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @ApiModelProperty("创建日期")
    private Date date;

    @ApiModelProperty("性别：男0，女1，未知2")
    private Integer sex;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("加盐")
    private String salt;

    @ApiModelProperty("头像")
    private String avatar;

    @ApiModelProperty("手机号")
    private String phone;

    @ApiModelProperty("用户唯一标识")
    private String cid;

    @ApiModelProperty("逻辑删除：0 未删除, 1 删除")
    private Integer deleted;
}
